<?php
/**
 * 
 * 
 */
define('NOROBOT', TRUE);
define('CURSCRIPT', 'gfcprofile');

require_once './include/common.inc.php';
require_once './plugins/gfc/common.php';
require_once './plugins/gfc/discuz.func.php';
$profile = getGFCProfile();
if ($_REQUEST['action'] == "update") {
  $update_level = 0;
  if ($_REQUEST['profilethumbnail'] == "1") {
    $update_level = $update_level | 1;
  }
  if ($_REQUEST['profilebio'] == "1") {
    $update_level = $update_level | 2;
  }
  if ($_REQUEST['profileurl'] == "1") {
    $update_level = $update_level | 4;
  }
  $uid = $discuz_uid;
  SyncUserProfile($profile, $uid, $update_level);
  echo "1";
} else if ($_REQUEST['action'] == "ajaxupdate") {
   $uid = $discuz_uid;
   SyncUserProfile($profile, $uid, 1|2|4);
   echo "1";
} else {
  $thum_url_before='';
  $thum_url_after='';
  $thum_bio_before='';
  $thum_bio_after='';
  $thum_site_before='';
  $thum_site_after='';
  $profilestatus = CheckProfile($profile);
  include template('gfcprofile');
}
?>